﻿using System.Collections;
using com.guojin.core.io.message;
using com.guojin.mj.net.message;
using com.guojin.mj.net.message.game;
using com.guojin.mj.net.message.login;
using UnityEngine;
using System.Collections.Generic;
using com.guojin.mj.net;

public class MessageManager : Observer
{
    private static MessageManager instance;
    public static MessageManager GetInstance()
    {
        return instance;
    }
    void Awake()
    {
        instance = this;
    }

    void Start()
    {
        initMsg();
    }

    protected override string[] GetMsgList()
    {
        return new[]
        {
            #region//瑞杰消息监听
            MessageFactoryImpi.instance.getMessageString(7,28),//shopping
            MessageFactoryImpi.instance.getMessageString(7,31),
            MessageFactoryImpi.instance.getMessageString(7,33),
            MessageFactoryImpi.instance.getMessageString(7,69),//俱乐部信息初步返回
            MessageFactoryImpi.instance.getMessageString(7,72),//创建俱乐部返回
            MessageFactoryImpi.instance.getMessageString(7,74),//俱乐部成员返回
            MessageFactoryImpi.instance.getMessageString(7,78),//审核列表
            MessageFactoryImpi.instance.getMessageString(7,80),//设置管理返回
            MessageFactoryImpi.instance.getMessageString(7,82),//转钱返回
            MessageFactoryImpi.instance.getMessageString(7,85),//是否成功申请俱乐部
            MessageFactoryImpi.instance.getMessageString(7,87),//是否同意加入俱乐部返回
            MessageFactoryImpi.instance.getMessageString(7,90),//修改俱乐部简介返回
            MessageFactoryImpi.instance.getMessageString(7,92),//解散俱乐部返回
            MessageFactoryImpi.instance.getMessageString(7,94),//退出俱乐部返回
            MessageFactoryImpi.instance.getMessageString(7,96),//升级俱乐部返回
            MessageFactoryImpi.instance.getMessageString(7,102),//联盟返回
            MessageFactoryImpi.instance.getMessageString(7,106),//联盟成员返回
            MessageFactoryImpi.instance.getMessageString(7,108),//加入联盟返回
            MessageFactoryImpi.instance.getMessageString(7,110),//创建联盟返回
            MessageFactoryImpi.instance.getMessageString(7,113),//待审核成员返回
            MessageFactoryImpi.instance.getMessageString(7,115),//审核成员结果返回
            MessageFactoryImpi.instance.getMessageString(7,117),//添加管理返回
            MessageFactoryImpi.instance.getMessageString(7,120),//解散联盟返回
            MessageFactoryImpi.instance.getMessageString(7,122),//退出联盟返回
            MessageFactoryImpi.instance.getMessageString(7,124),//升级联盟返回
            MessageFactoryImpi.instance.getMessageString(7,126),//联盟公告返回
            MessageFactoryImpi.instance.getMessageString(7,128),//俱乐部续费返回
            MessageFactoryImpi.instance.getMessageString(7,130),//联盟续费返回
            MessageFactoryImpi.instance.getMessageString(7,132),//战绩返回
            MessageFactoryImpi.instance.getMessageString(7,135),//房间战绩返回
            MessageFactoryImpi.instance.getMessageString(7,141),//发现
            MessageFactoryImpi.instance.getMessageString(7,145),//是否开启短信验证
            MessageFactoryImpi.instance.getMessageString(7,147),//短信验证是否正确
            MessageFactoryImpi.instance.getMessageString(7,150),//账号登录失败
            MessageFactoryImpi.instance.getMessageString(7,152),//获取验证码失败
            MessageFactoryImpi.instance.getMessageString(7,154),//修改失败
            MessageFactoryImpi.instance.getMessageString(7,156),//问题返回
            MessageFactoryImpi.instance.getMessageString(7,157),//有人需要带入
            MessageFactoryImpi.instance.getMessageString(7,159),//获取带入消息
            MessageFactoryImpi.instance.getMessageString(7,161),//需要带入返回
            MessageFactoryImpi.instance.getMessageString(7,164),
            MessageFactoryImpi.instance.getMessageString(7,165),
            MessageFactoryImpi.instance.getMessageString(7,166),
            MessageFactoryImpi.instance.getMessageString(7,168),
            MessageFactoryImpi.instance.getMessageString(7,170),
#endregion
            MessageFactoryImpi.instance.getMessageString(7, 9), //登录错误
            MessageFactoryImpi.instance.getMessageString(7, 10), //登录成功
            MessageFactoryImpi.instance.getMessageString(7, 15), //pang 
            MessageFactoryImpi.instance.getMessageString(7, 16), //广播
            MessageFactoryImpi.instance.getMessageString(7, 17), //重复登录
            MessageFactoryImpi.instance.getMessageString(7, 13), //房卡变动

            MessageFactoryImpi.instance.getMessageString(7, 1), //创建房间返回   
            MessageFactoryImpi.instance.getMessageString(7, 7), //加入房间返回      
            MessageFactoryImpi.instance.getMessageString(7, 11), //创建，加入异常原因  
            MessageFactoryImpi.instance.getMessageString(12, 7), //scene端加入返回房间信息
            MessageFactoryImpi.instance.getMessageString(12, 8), //玩家信息
            MessageFactoryImpi.instance.getMessageString(12, 9),  //每局结算信息
            MessageFactoryImpi.instance.getMessageString(12, 25),  //语音
            MessageFactoryImpi.instance.getMessageString(12, 19), //玩家掉线消息  

            MessageFactoryImpi.instance.getMessageString(12,32),
            MessageFactoryImpi.instance.getMessageString(12, 33),
            MessageFactoryImpi.instance.getMessageString(12, 34),   //补充积分
            MessageFactoryImpi.instance.getMessageString(12, 48),   //申请带入
            MessageFactoryImpi.instance.getMessageString(12, 3),     //收到开始发牌消息

            MessageFactoryImpi.instance.getMessageString(12, 38),  //抢庄
            MessageFactoryImpi.instance.getMessageString(12, 11),  //出牌
            MessageFactoryImpi.instance.getMessageString(12, 13),  //下注
            MessageFactoryImpi.instance.getMessageString(12,15),   //开始出牌

            MessageFactoryImpi.instance.getMessageString(7, 3), //解散房间
            MessageFactoryImpi.instance.getMessageString(7, 5), //退出房间
            MessageFactoryImpi.instance.getMessageString(12, 42),  //实时战绩
            MessageFactoryImpi.instance.getMessageString(12, 46),  //上手回顾
            MessageFactoryImpi.instance.getMessageString(12, 40), //房间设置
            MessageFactoryImpi.instance.getMessageString(12, 50), //踢人
            MessageFactoryImpi.instance.getMessageString(12, 52), //付费表情
            MessageFactoryImpi.instance.getMessageString(12, 54), //资产查询

        };
    }

    public override void OnMsg(string msg, Message data)
    {
        #region//登录消息
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 31))
            GameController.GetInstance().Get731(msg, data);
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 166))
            LoginController.GetInstance().OnReceiveMsg7166(msg, data);
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 9))
            LoginController.GetInstance().OnReceiveMsg79(msg, data);

        if (msg == MessageFactoryImpi.instance.getMessageString(7, 10))
            LoginController.GetInstance().OnReceiveMsg710(msg, data);

        if (msg == MessageFactoryImpi.instance.getMessageString(7, 15))
            WorldTime.Instance.ReceiveMsg715(msg, data);
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 33))
            GameController.GetInstance().Get733(msg, data);
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 16))
            GameHallController.GetInstance().OnReceviceMsg716(msg, data);

        if (msg == MessageFactoryImpi.instance.getMessageString(7, 17))
            LoginController.GetInstance().OnReceiveMsg717(msg, data);

        if (msg == MessageFactoryImpi.instance.getMessageString(7, 13))
            RoomCard.GetInstance().OnReceiveMsg713(msg, data);

        if (msg == MessageFactoryImpi.instance.getMessageString(12, 25))
        {
            if (!GameObject.Find("GameRoomPage(Clone)")) return;

            MicReciveMessagePage.GetInstance().OnReceiveMsg1225(msg, data);
            ChatReciveMessagePage.GetInstance().OnReceiveMsg1225(msg, data);
        }
        #endregion

        if (msg == MessageFactoryImpi.instance.getMessageString(7, 1))
            CreateRoomController.GetInstance().OnReceiveMsg71(msg, data);

        if (msg == MessageFactoryImpi.instance.getMessageString(7, 7))
            JoinRoomController.GetInstance().OnReceiveMsg77(msg, data);

        if (msg == MessageFactoryImpi.instance.getMessageString(7, 11))
            NoticeController.GetInstance().OnReceiveMsg711(msg, data);

        if (msg == MessageFactoryImpi.instance.getMessageString(12, 7))
            GameRoomController.GetInstance().OnReceiveMsg127(msg, data);

        if (msg == MessageFactoryImpi.instance.getMessageString(12, 8))
        {
            if (!GameObject.Find("GameRoomPage(Clone)")) return;
            GameController.GetInstance().OnReceive128(msg, data);
        }

        if (msg == MessageFactoryImpi.instance.getMessageString(12, 9))
        {
            if (!GameObject.Find("GameRoomPage(Clone)")) return;
            ChapterEndController.GetInstance().OnReceviceMsg129(msg, data);
        }

        if (msg == MessageFactoryImpi.instance.getMessageString(12, 32))
        {
            if (!GameObject.Find("GameRoomPage(Clone)")) return;
            GameController.GetInstance().OnReceive1232(msg, data);
        }     

        if (msg == MessageFactoryImpi.instance.getMessageString(12, 33))
        {
            if (!GameObject.Find("GameRoomPage(Clone)")) return;
            GameController.GetInstance().OnReceive1233(msg, data);
        }
     

        if (msg == MessageFactoryImpi.instance.getMessageString(12, 34))
        {
            if (!GameObject.Find("GameRoomPage(Clone)")) return;
            GameController.GetInstance().OnReceive1234(msg, data);
        }
        

        if (msg == MessageFactoryImpi.instance.getMessageString(12, 48))
            Debug.Log("12.48不应该再发");

        if (msg == MessageFactoryImpi.instance.getMessageString(12, 3))
        {
            if (!GameObject.Find("GameRoomPage(Clone)")) return;
            GameController.GetInstance().OnRecive123(msg, data);
        }

        if (msg == MessageFactoryImpi.instance.getMessageString(12, 38))
        {
            if (!GameObject.Find("GameRoomPage(Clone)")) return;
            GameController.GetInstance().OnReceive1238(msg, data);
        }
      

        if (msg == MessageFactoryImpi.instance.getMessageString(12, 11))
        {
            if (!GameObject.Find("GameRoomPage(Clone)")) return;
            GameController.GetInstance().OnReceive1211(msg, data);
        }
       

        if (msg == MessageFactoryImpi.instance.getMessageString(12, 13))
        {
            if (!GameObject.Find("GameRoomPage(Clone)")) return;
            GameController.GetInstance().OnReceive1213(msg, data);

        }

        if (msg == MessageFactoryImpi.instance.getMessageString(12, 15))
        {
            if (!GameObject.Find("GameRoomPage(Clone)")) return;
            GameController.GetInstance().OnReceive1215(msg, data);
        }


        if (msg == MessageFactoryImpi.instance.getMessageString(7, 3))
        {
            if (!GameObject.Find("GameRoomPage(Clone)")) return;
            GameRoomController.GetInstance().OnReceiveMsg73(msg, data);
        }

        if (msg == MessageFactoryImpi.instance.getMessageString(7, 5))
        {
            if (!GameObject.Find("GameRoomPage(Clone)")) return;
            GameRoomController.GetInstance().OnReceiveMsg75(msg, data);
        }

        if (msg == MessageFactoryImpi.instance.getMessageString(12, 42)) //实时战绩
        {
            if (!GameObject.Find("GameRoomPage(Clone)")) return;
            GameController.GetInstance().OnReceive1242(msg, data);
        }
     

        if (msg == MessageFactoryImpi.instance.getMessageString(12, 46)) //上手回顾
        {
            if (!GameObject.Find("GameRoomPage(Clone)")) return;
            GameController.GetInstance().OnReceive1246(msg, data);
        }
      

        if (msg == MessageFactoryImpi.instance.getMessageString(12, 40))        //房间设置
        {
            if (!GameObject.Find("GameRoomPage(Clone)")) return;
            GameController.GetInstance().OnReceive1240(msg, data);
        }

        if (msg == MessageFactoryImpi.instance.getMessageString(12, 50))         //踢人结果
        {
            if (!GameObject.Find("GameRoomPage(Clone)")) return;
            GameController.GetInstance().OnReceive1250(msg, data);
        }
       

        if (msg == MessageFactoryImpi.instance.getMessageString(12, 52))             //付费表情
        {
            if (!GameObject.Find("GameRoomPage(Clone)")) return;
            GameController.GetInstance().OnReceive1252(msg, data);
        }


        if (msg == MessageFactoryImpi.instance.getMessageString(12, 54))             //付费表情
        {
            if (!GameObject.Find("GameRoomPage(Clone)")) return;

            if (GameObject.Find("PlayerInfoPage(Clone)"))
            {
                GameObject.Find("PlayerInfoPage(Clone)").GetComponent<PlayerInfoPage>().OnReceiveMsg1254(msg, data);
            }
        }

        #region //瑞杰监听
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 69))
        {
            GameController.GetInstance().Get769(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 72))
        {
            GameController.GetInstance().Get772(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 78))
        {
            GameController.GetInstance().Get778(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 80))
        {
            GameController.GetInstance().Get780(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 82))
        {
            GameController.GetInstance().Get782(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 85))
        {
            GameController.GetInstance().Get785(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 87))
        {
            GameController.GetInstance().Get787(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 90))
        {
            GameController.GetInstance().Get790(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 92))
        {
            GameController.GetInstance().Get792(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 74))
        {
            GameController.GetInstance().Get774(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 94))
        {
            GameController.GetInstance().Get794(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 96))
        {
            GameController.GetInstance().Get796(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 102))
        {
            GameController.GetInstance().Get7102(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 106))
        {
            GameController.GetInstance().Get7106(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 108))
        {
            GameController.GetInstance().Get7108(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 110))
        {
            GameController.GetInstance().Get7110(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 113))
        {
            GameController.GetInstance().Get7113(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 115))
        {
            GameController.GetInstance().Get7115(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 117))
        {
            GameController.GetInstance().Get7117(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 120))
        {
            GameController.GetInstance().Get7120(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 122))
        {
            GameController.GetInstance().Get7122(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 124))
        {
            GameController.GetInstance().Get7124(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 126))
        {
            GameController.GetInstance().Get7126(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 128))
        {
            GameController.GetInstance().Get7128(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 130))
        {
            GameController.GetInstance().Get7130(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 132))
        {
            GameController.GetInstance().Get7132(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 135))
        {
            GameController.GetInstance().Get7135(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 141))
        {
            GameController.GetInstance().Get7141(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 145))
        {
            GameController.GetInstance().Get7145(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 147))
        {
            GameController.GetInstance().Get7147(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 150))
        {
            GameController.GetInstance().Get7150(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 152))
        {
            GameController.GetInstance().Get7152(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 154))
        {
            GameController.GetInstance().Get7154(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 156))
        {
            GameController.GetInstance().Get7156(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 157))
        {
            GameController.GetInstance().Get7157(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 159))
        {
            GameController.GetInstance().Get7159(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 161))
        {
            GameController.GetInstance().Get7161(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 164))
        {
            GameController.GetInstance().Get7164(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 165))
        {
            GameController.GetInstance().Get7165(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 168))
        {
            GameController.GetInstance().Get7168(msg, data);
        }
        if (msg == MessageFactoryImpi.instance.getMessageString(7, 170))
        {
            GameController.GetInstance().Get7170(msg, data);
        }
        #endregion

        if (msg == MessageFactoryImpi.instance.getMessageString(7, 28))
        {
            var wxpr = (SHWXPayRet)data;
            Debug.Log(wxpr.Reault);
            if (wxpr.Reault)
                LoginAndShare.Controller.OnRecePayRet(wxpr.Appid, wxpr.Noncestr, wxpr.Package, wxpr.Partnerid,
                    wxpr.Prepayid, wxpr.Timestamp, wxpr.Sign);
            else
                Debug.Log("微信支付失败");
        }
    }

    ///-----------------------------我的发送消息代码————————————————————————
       #region//登录 乒乓 微信分享 语音 坐标
    public void SendMsg78(string type, string token, string wxCode, string longitude, string latitude)
    {
        LoginReq log = LoginReq.create(type, token, wxCode, longitude, latitude);
        SocketMgr.GetInstance().Send(Net.instance.write(log));
    }

    public void SendMsg714(string str)
    {
        SHPing ping = SHPing.create(str);
        SocketMgr.GetInstance().Send(Net.instance.write(ping));
    }

    public void SendMsg732()
    {
        //WeiXinShareReq weiXinShareReq = new WeiXinShareReq();
        //SocketMgr.GetInstance().Send(Net.instance.write(weiXinShareReq));
    }

    public void SendMsg1224(string ID, int msgType)
    {
        PlayerSendChatInfo req = PlayerSendChatInfo.create(ID, msgType);
        SocketMgr.GetInstance().Send(com.guojin.mj.net.Net.instance.write(req));
    }

    public void SendMsg135(int _locationIndex, string _longitude, string _latitude)                  //向服务器发送经纬度
    {
        ReqLocation req = ReqLocation.Creat(0, _longitude, _latitude);
        SocketMgr.GetInstance().Send(Net.instance.write(req));
    }
    #endregion

    #region//创建加入房间
    public void SendMsg70(List<OptionEntry> options)
    {
        var cr = CreateRoomReq.create(options);
        SocketMgr.GetInstance().Send(Net.instance.write(cr));
    }

    public void SendMsg76(string roomID)
    {
        var jr = JoinRoomReq.create(roomID);
        SocketMgr.GetInstance().Send(Net.instance.write(jr));
    }

    public void SendMsg126()
    {
        var Gjr = new GameRoomInfoReq();
        SocketMgr.GetInstance().Send(Net.instance.write(Gjr));
    }
    #endregion

    #region//坐下带入积分
    public void SendMsg1231(int sitDownType, int userId)
    {
        SitDownReq sd = SitDownReq.create(sitDownType, userId);
        SocketMgr.GetInstance().Send(Net.instance.write(sd));
    }

    public void SendMsg1233(int score, int locationIndex, string approver)
    {
        TakeInScoreReq ts = TakeInScoreReq.create(score, locationIndex, approver);
        SocketMgr.GetInstance().Send(Net.instance.write(ts));
    }

    public void SendMsg1236(bool reqResult, int locationIndex)
    {
        TakeInScoreToHostReq tsth = TakeInScoreToHostReq.create(reqResult, locationIndex);
        SocketMgr.GetInstance().Send(Net.instance.write(tsth));
    }

    #endregion

    #region //开始游戏 抢庄下注出牌
    public void SendMsg121()
    {
        StartGameReq sg = StartGameReq.Creat();
        SocketMgr.GetInstance().Send(Net.instance.write(sg));
    }

    public void SendMsg1237(int locationIndex)      //抢庄
    {
        VieForZhuangReq vfz = VieForZhuangReq.create(locationIndex);
        SocketMgr.GetInstance().Send(Net.instance.write(vfz));
    }

    public void SendMsg1210(int locationIndex, int dealType, int[] cards)
    {
        var bir = PlayCardReq.Creat(locationIndex, dealType, cards);
        SocketMgr.GetInstance().Send(Net.instance.write(bir));
    }

    public void SendMsg1212(int betType, int locationIndex, int betOrCallScore)
    {
        var bir = BetInfoReq.Creat(betType, locationIndex, betOrCallScore);
        SocketMgr.GetInstance().Send(Net.instance.write(bir));
    }
    #endregion

    #region//结算返回解散房间
    public void SendMsg1214(int locationIndex, bool isClickThisChapter)
    {
        var pcr = PlayerClickReq.create(locationIndex, isClickThisChapter);
        SocketMgr.GetInstance().Send(Net.instance.write(pcr));
    }

    public void SendMsg1229(int userID)
    {
        ExitRoomReq erq = ExitRoomReq.create(userID);
        SocketMgr.GetInstance().Send(Net.instance.write(erq));
    }
    #endregion

    #region//实时战绩上手回顾房间设置
    public void SendMsg1241(string userID)
    {
        CurrentWarRecordReq cwr = CurrentWarRecordReq.create(int.Parse( userID));
        SocketMgr.GetInstance().Send(Net.instance.write(cwr));
    }

    public void SendMsg1245(int userID)
    {
        OnceBeforeReq obr = OnceBeforeReq.create(userID);
        SocketMgr.GetInstance().Send(Net.instance.write(obr));
    }

    public void SendMsg1239(int changeType, int minScore, int maxScore, int addTime, string  roomId)
    {
        MidChangeRoomInfoReq mcr = MidChangeRoomInfoReq.create(changeType, minScore, maxScore, addTime, roomId);
        SocketMgr.GetInstance().Send(Net.instance.write(mcr));
    }

    public void SendMsg1249(string name, int userId, int outUserId)
    {
        LetSbOutReq lso = LetSbOutReq.create(name, userId, outUserId);
        SocketMgr.GetInstance().Send(Net.instance.write(lso));
    }

    public void SendMsg1251(int emoji, int price,  int sendIndex, int receiveIndex)
    {
        PayEmojiReq per = PayEmojiReq.create(emoji, price, sendIndex, receiveIndex);
        SocketMgr.GetInstance().Send(Net.instance.write(per));
    }

    public void SendMsg1254(int userId, int gold)
    {
        CheckGoldReq cg = CheckGoldReq.create(userId, gold);
        SocketMgr.GetInstance().Send(Net.instance.write(cg));
    }

    #endregion
    ///-----------------------------我的发送消息代码———————————————————————

    #region//瑞杰发送消息代码-------------------------------------------------------------------------
    public void SendMsg768()                  //点击俱乐部
    {
        GetClubMessage cm = new GetClubMessage();
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }

    public void SendMsg771(string head,string name)                  //创建俱乐部
    {
        CreateClub cm = CreateClub.creaet(head,name);
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
    public void SendMsg776(int clubid)                  //创建俱乐部
    {
        GetCheckNumber cm = GetCheckNumber.Create(clubid);
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
    public void SendMsg789(int clubid, string name)                  //创建俱乐部
    {
        ChageMyIntro cm = ChageMyIntro.create(clubid, name);
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
    public void SendMsg784(int clubid)                  //创建俱乐部
    {
        JoinClub cm = JoinClub.create(clubid);
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
    public void SendMsg786(int ret,int usid,string cuid)
    {
        ClubOwnerRet sr = ClubOwnerRet.create(ret,usid,cuid);
        SocketMgr.GetInstance().Send(Net.instance.write(sr));
    }
    public void SendMsg779(int id, int cuid)
    {
        SetAdmain sr = SetAdmain.Create( id, cuid);
        SocketMgr.GetInstance().Send(Net.instance.write(sr));
    }
    public void SendMsg773(string cuid)
    {
        GetClubInfo sr = GetClubInfo.cretae(cuid);
        SocketMgr.GetInstance().Send(Net.instance.write(sr));

    }
    public void SendMsg781(int id, int money)
    {
        SendMoney sr = SendMoney.create(id, money);
        SocketMgr.GetInstance().Send(Net.instance.write(sr));
    }
    public void SendMsg791(int id)
    {
        DissolveClub sr = DissolveClub.Create(id);
        SocketMgr.GetInstance().Send(Net.instance.write(sr));
    }
    public void SendMsg795(int _level,int clubid)                  //升级俱乐部
    {
        UpgradeClub cm = UpgradeClub.Create( _level,clubid);
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
    public void SendMsg793(int _id, int clubid)                  
    {
        GetwayClub cm = GetwayClub.Create(_id, clubid);
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
    public void Send7101()                  //获取联盟
    {
        GetAllLM cm = new GetAllLM();
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
    public void Send7104(int lmid)                  //获取联盟成员
    {
        GetLmNumber cm = GetLmNumber.Create(lmid);
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
    public void SendMsg7107(int _id, int lmid)                 
    {
        JoinAlliance cm = JoinAlliance.Create(_id, lmid);
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
   
    public void SendMsg7109(string _id, string lmid)                 
    {
        CreateAlliance cm = CreateAlliance.Create(_id, lmid);
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
    public void Send7111(int lmid)
    {
        CheckLM cm = CheckLM.Create(lmid);
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
    public void SendMsg7114(int ret, int usid, string cuid)
    {
        AllianceOpinion sr = AllianceOpinion.create(ret, usid, cuid);
        SocketMgr.GetInstance().Send(Net.instance.write(sr));
    }
    public void SendMsg7116(int id, int cuid)
    {
        AddAdmin sr = AddAdmin.Create(id, cuid);
        SocketMgr.GetInstance().Send(Net.instance.write(sr));
    }
    public void Send7119(int lmid) {
        ClearLm cm = ClearLm.Create( lmid);
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
    public void SendMsg7121(int _id, int clubid)
    {
        ExitAlliance cm = ExitAlliance.Create(_id, clubid);
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
    public void SendMsg7123(int _level, int clubid)                  //创建俱乐部
    {
        UpgradeAlliance cm = UpgradeAlliance.Create(_level, clubid);
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
    public void Send7125(int lmid, string lmsaid)                  //创建俱乐部
    {
        LMSaid cm = LMSaid.Create(lmid, lmsaid);
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
    public void Send7127(int lvid)                  //俱乐部续费
    {
        Renew cm = Renew.Create(lvid);
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
    public void Send7129(int lvid)                  //联盟续费
    {
        LMRenews cm = LMRenews.Create(lvid);
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
    public void Send7131(int type, string id)                  //获取战绩
    {
        Gethistory cm = Gethistory.Create(type,id);
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
    public void Send7134(string roomid)                  //获取战绩
    {
        GetHistoryRoom cm = GetHistoryRoom.Create(roomid);
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
    public void Send7140()                  //发现
    {
        GetRoomMsg cm = new GetRoomMsg();
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
    public void Send7144(string acc,string pas)          
    {
        PhoneRegister cm = PhoneRegister.Create(acc,pas);
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
    public void Send7146(string acc, string code)
    {
        VerificationCode cm = VerificationCode.Create(acc, code);
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
    public void Send7148(string av,string name, int sex,string ph,string pa)
    {
        PhoneLogin cm = PhoneLogin.Create(av, name, sex,ph,pa);
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
    public void Send7149(string ac, string pas)
    {
        AccoutLogin cm = AccoutLogin.Create(ac, pas);
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
    public void Send7151(string phone)
    {
        ForGetPassword cm = ForGetPassword.Create(phone);
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
    public void Send7153(string phone, string code, string pa)
    {
        ChangePassword cm = ChangePassword.Create(phone, code, pa);
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
    public void Send7155(int type,string said, string code, string account)
    {
        LiuYan cm = LiuYan.Create(type,said, code, account);
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
    public void Send7158(int id)
    {
        ToSeeDaiRu cm = ToSeeDaiRu.Create(id);
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }
    public void Send7160(bool b,int id,int Index, string roomId)
    {
        ChoiceDairu cm = ChoiceDairu.Create(b,id, Index, roomId);
        SocketMgr.GetInstance().Send(Net.instance.write(cm));
    }

    public void Send7163(int num)
    {
        ZhuanGold zg = ZhuanGold.Create(num);
        SocketMgr.GetInstance().Send(Net.instance.write(zg));
    }
    public void Send7167(string num,int id)
    {
        GOAway zg = GOAway.create(num,id);
        SocketMgr.GetInstance().Send(Net.instance.write(zg));
    }
    public void Send7169(string num, int id)
    {
        GOAwayLM zg = GOAwayLM.create(num, id);
        SocketMgr.GetInstance().Send(Net.instance.write(zg));
    }
    #endregion
}